import request from '@/utils/request'

const PATH = '/pms/category'

export function findAllCategoryREQ(params) {
  return request({
    url: `${PATH}/find`,
    method: 'GET',
    params
  })
}

export function pageCategoryREQ(params) {
  return request({
    url: `${PATH}`,
    method: 'GET',
    params
  })
}

export function createCategoryREQ(data) {
  return request({
    url: PATH,
    method: 'post',
    data
  })
}
export function getCategoryByIdREQ(id) {
  return request({
    url: `${PATH}/${id}`,
    method: 'GET'
  })
}

export function updateCategoryREQ(data) {
  return request({
    url: PATH,
    method: 'put',
    data
  })
}

export function deleteCategoryREQ(id) {
  return request({
    url: `${PATH}/${id}`,
    method: 'delete'
  })
}
